home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
- /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
- /* All Rights Reserved */
-
- /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
- /* UNIX System Laboratories, Inc. */
- /* The copyright notice above does not evidence any */
- /* actual or intended publication of such source code. */
-
- /*
- * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- * PROPRIETARY NOTICE (Combined)
- *
- * This source code is unpublished proprietary information
- * constituting, or derived under license from AT&T's UNIX(r) System V.
- * In addition, portions of such source code were derived from Berkeley
- * 4.3 BSD under license from the Regents of the University of
- * California.
- *
- *
- *
- * Copyright Notice
- *
- * Notice of copyright on this source code product does not indicate
- * publication.
- *
- * (c) 1986,1987,1988,1989 Sun Microsystems, Inc
- * (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
- * All rights reserved.
- *
- */
-
- #ifndef _SYS_PARAM_H
- #define _SYS_PARAM_H
-
- #include <sys/types.h>
- #include <sys/signal.h> /* BSD/IRIX4 compat */
-
- #ifndef _PAGESZ /* for backward compatibility */
- #define _PAGESZ 4096 /* with old user programs */
- #endif /* and stand-alone */
-
- /*
- * Fundamental variables; don't change too often.
- */
-
- /* POSIX version number, returned by sysconf() system call */
- #ifndef _POSIX_VERSION
- #define _POSIX_VERSION 199009L
- #endif
-
- #ifndef _POSIX_VDISABLE
- #define _POSIX_VDISABLE 0 /* Disable special character functions */
- #endif
-
- #ifndef MAX_INPUT
- #define MAX_INPUT 512 /* Maximum bytes stored in the input queue */
- #endif
-
- #ifndef MAX_CANON
- #define MAX_CANON 256 /* Maximum bytes in a line for canoical processing */
- #endif
-
- #define UID_NOBODY 60001 /* user ID no body */
- #define GID_NOBODY UID_NOBODY
-
- #define UID_NOACCESS 60002 /* user ID no access */
-
- #define MAXPID 30000 /* max process id */
- #define MAXUID 60002 /* max user id */
- #define MAXLINK 30000 /* max links */
-
- #define SSIZE 1 /* initial stack size (*NBPP bytes) */
- #define SINCR 1 /* increment of stack (*NBPP bytes) */
-
- #if _PAGESZ == 4096
- #define USIZE 2 /* size of user block (*NBPP bytes) */
- #define EXTUSIZE 1 /* size of ustk extension (*NBPP bytes) */
- #define UPGIDX 0
- #define KSTKIDX 1
- #define KSTEIDX 2 /* Kernel stack extension index */
- #else
- #define USIZE 1 /* size of user block (*NBPP bytes) */
- #define UPGIDX 0
- #define KSTKIDX 0
- #define EXTUSIZE 0 /* size of ustk extension (*NBPP bytes) */
- #endif /* _PAGESZ == 4096 */
-
- #define CANBSIZ 256 /* max size of typewriter line */
- #define HZ 100 /* 100 ticks/second of the clock */
- #define TICK 10000000 /* nanoseconds per tick */
-
- #define NOFILE 20 /* this define is here for */
- /* compatibility purposes only */
- /* and will be removed in a */
- /* later release */
-
- /*
- * These define the maximum and minimum allowable values of the
- * configurable parameter NGROUPS_MAX.
- */
- #define NGROUPS_UMIN 0
- #define NGROUPS_UMAX 32
-
- /*
- * NGROUPS must not be set greater than NGROUPS_MAX in master.d/kernel.
- * Compilation will not succeed in that case.
- */
- #define NGROUPS 16 /* max # groups process may be in */
-
- /*
- * Priorities. Should not be altered too much.
- */
-
- #define PMASK 0177
- #define PCATCH 0400
- #define PRECALC 01000
- #define PNOSTOP 02000
- #define PSWP 0
- #define PINOD 10
- #define PSNDD PINOD
- #define PRIBIO 20
- #define PZERO 25
- #define PMEM 0
- #ifndef NZERO
- #define NZERO 20
- #endif
- #define PPIPE 26
- #define PVFS 27
- #define PWAIT 30
- #define PSLEP 39
- #define PUSER 60
- #define PIDLE 255
-
- /*
- * fundamental constants of the implementation--
- * cannot be changed easily
- *
- * On the MIPS CPU a click is a page (4K), a segment is what a click can
- * map (i.e. a page of ptes or 4K/sizeof(pte) * 4K = 4 meg (for 4 byte ptes))
- */
-
- #define NBPS (NCPS*NBPC) /* Number of bytes per segment */
- #define NBPW sizeof(int) /* number of bytes in an integer */
- #define NCPS (NBPC/(sizeof(void *))) /* Number of clicks per segment */
-
- #define IO_NBPC 4096 /* Number of bytes per click for DMA purposes */
- #define IO_BPCSHIFT 12 /* LOG2(IO_NBPC) if exact */
-
- #define MIN_NBPC 4096 /* Minimum number of bytes per click */
- #define MIN_BPCSHIFT 12 /* LOG2(MIN_NBPC) if exact */
- #define MIN_CPSSHIFT 10 /* LOG2(MIN_NCPS) if exact */
-
- #define NBPC _PAGESZ /* Number of bytes per click */
-
- #if NBPC == 4096
- #define BPCSHIFT 12 /* LOG2(NBPC) if exact */
- #define CPSSHIFT 10 /* LOG2(NCPS) if exact */
- #endif
- #if NBPC == 16384
- #define BPCSHIFT 14 /* LOG2(NBPC) if exact */
- #define CPSSHIFT 12 /* LOG2(NCPS) if exact */
- #endif
- #if NBPC == 65536
- #define BPCSHIFT 16 /* LOG2(NBPC) if exact */
- #define CPSSHIFT 14 /* LOG2(NCPS) if exact */
- #endif
-
- #ifndef NULL
- #define NULL 0
- #endif
- #define CMASK 022 /* default mask for file creation */
- #define CDLIMIT 0x7fffffff /* default max write address */
- #define NODEV (dev_t)(-1)
- #define NOPAGE ((unsigned int)-1)
-
- /*
- * XXX These should be expunged, and BBSHIFT should be defined as 9.
- */
- #define NBPSCTR 512 /* Bytes per disk sector. */
- #define SCTRSHFT 9 /* Shift for BPSECT. */
- #define UBSIZE 512 /* unix block size. */
-
- #define UMODE 3 /* current Xlevel == user */
- /* in mips the psw is the status register */
- #define BASEPRI(psw) (((psw) & SR_IMASK) == SR_IMASK)
- #if R3000
- #define USERMODE(psw) (((psw) & SR_KUP) == SR_KUP)
- #endif
- #if R4000 || TFP
- #define USERMODE(psw) (((psw) & SR_KSU_MSK) == SR_KSU_USR)
- #endif
-
- #ifdef MIPSEB
- #define lobyte(X) (((unsigned char *)&X)[1])
- #define hibyte(X) (((unsigned char *)&X)[0])
- #define loword(X) (((ushort *)&X)[1])
- #define hiword(X) (((ushort *)&X)[0])
- #else
- #define lobyte(X) (((unsigned char *)&X)[0])
- #define hibyte(X) (((unsigned char *)&X)[1])
- #define loword(X) (((ushort *)&X)[0])
- #define hiword(X) (((ushort *)&X)[1])
- #endif
-
-
- #define MAXSUSE 255
-
- /* REMOTE -- whether machine is primary, secondary, or regular */
- #define SYSNAME 9 /* # chars in system name */
- #define PREMOTE 39
-
- /*
- * MAXPATHLEN defines the longest permissible path length,
- * including the terminating null, after expanding symbolic links.
- * MAXSYMLINKS defines the maximum number of symbolic links
- * that may be expanded in a path name. It should be set high
- * enough to allow all legitimate uses, but halt infinite loops
- * reasonably quickly.
- * MAXNAMELEN is the length (including the terminating null) of
- * the longest permissible file (component) name.
- */
- #define MAXPATHLEN 1024
- #define MAXSYMLINKS 30
- #define MAXNAMELEN 256
-
- #ifndef NADDR
- #define NADDR 13
- #endif
-
- /*
- * The following are defined to be the same as
- * defined in /usr/include/limits.h. They are
- * needed for pipe and FIFO compatibility.
- */
- #ifndef PIPE_BUF /* max # bytes atomic in write to a pipe */
- #define PIPE_BUF 10240
- #endif /* PIPE_BUF */
-
- #ifndef PIPE_MAX /* max # bytes written to a pipe in a write */
- #define PIPE_MAX 10240
- #endif /* PIPE_MAX */
-
- #ifndef NBBY
- #define NBBY 8 /* number of bits per byte */
- #endif /* NBBY */
-
- /*
- * Block I/O parameterization. A basic block (BB) is the lowest size of
- * filesystem allocation, and must == NBPSCTR. Length units given to bio
- * routines are in BB's.
- */
- #define BBSHIFT 9
- #define BBSIZE (1<<BBSHIFT)
- #define BBMASK (BBSIZE-1)
- #define BTOBB(bytes) (((unsigned long)(bytes) + BBSIZE - 1) >> BBSHIFT)
- #define BTOBBT(bytes) ((unsigned long)(bytes) >> BBSHIFT)
- #define BBTOB(bbs) ((bbs) << BBSHIFT)
-
- #define SEEKLIMIT 0x7fffffff
- #define BBSEEKLIMIT BTOBBT(SEEKLIMIT)
-
- /*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units,
- * with smaller units (fragments) only in the last direct block.
- * MAXBSIZE primarily determines the size of buffers in the buffer
- * pool. It may be made larger without any effect on existing
- * file systems; however making it smaller make make some file
- * systems unmountable.
- *
- * Note that the blocked devices are assumed to have DEV_BSIZE
- * "sectors" and that fragments must be some multiple of this size.
- */
- #define MAXBSIZE 8192
- #define DEV_BSIZE BBSIZE
- #define DEV_BSHIFT BBSHIFT /* log2(DEV_BSIZE) */
-
- #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- ((unsigned)(bytes) >> DEV_BSHIFT)
- #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((unsigned)(db) << DEV_BSHIFT)
-
- /*
- * Maximum size of hostname and domainname recognized and stored in the
- * kernel by sethostname and setdomainname
- */
- #define MAXHOSTNAMELEN 64
-
- /*
- * Macros for fast min/max.
- */
- #define MIN(a,b) (((a)<(b))?(a):(b))
- #define MAX(a,b) (((a)>(b))?(a):(b))
-
- /*
- * Macros for counting and rounding.
- */
- #ifndef howmany
- #define howmany(x, y) (((x)+((y)-1))/(y))
- #endif
- #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-
- #if defined(_KERNEL) || defined(_STANDALONE)
- /*
- * DELAY(n) should be n microseconds, roughly.
- */
- #define DELAY(n) us_delay(n)
- /* to guarentee delay between writes, use DELAYBUS */
- #define DELAYBUS(n) us_delaybus(n)
-
- /* timeout call with this tick results in immediate timepoke()
- */
- #define TIMEPOKE_NOW -100
- extern int ngroups_max; /* master.d/kernel */
- #endif /* _KERNEL || _STANDALONE */
-
- #endif /* _SYS_PARAM_H */
-